<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <title><?php echo C('SYSTEM_NAME');?></title>
    <!--&lt;!&ndash; jQuery文件。务必在bootstrap.min.js 之前引入 &ndash;&gt;-->
<!--<script src="http://apps.bdimg.com/libs/jquery/1.11.3/jquery.min.js"></script>-->
<!--&lt;!&ndash; 最新的 Bootstrap 核心 JavaScript 文件 &ndash;&gt;-->
<!--<script src="http://apps.bdimg.com/libs/bootstrap/3.3.4/js/bootstrap.min.js"></script>-->

<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/jquery.min.js"></script>
<script type="text/javascript" src="http://zt.dreamhup.com/public/static/adminlte/bootstrap/js/bootstrap.min.js"></script>


<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/jquery.json.min.js"></script>


<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/easyui/locale/easyui-lang-zh_CN.js"></script>

<script type="text/javascript" src="http://zt.dreamhup.com/public/static/adminlte/plugins/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="http://zt.dreamhup.com/public/static/adminlte/plugins/datepicker/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="http://zt.dreamhup.com/public/static/adminlte/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<!-- 辅助功能 -->
<script src="http://zt.dreamhup.com/public/static/js/app.js"></script>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'> 
 <!-- 新 Bootstrap 核心 CSS 文件 -->
<!--<link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.min.css">-->
<link rel="stylesheet" type="text/css" href="http://zt.dreamhup.com/public/static/css/admin/icons.css" />
<!-- Font Awesome Icons -->
<link href="http://zt.dreamhup.com/public/static/adminlte/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<!-- Ionicons -->
<!--<link href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />-->

<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="http://zt.dreamhup.com/public/static/adminlte/bootstrap/css/bootstrap.min.css"/>
<!-- Font Awesome Icons -->
<!--<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />-->
<!-- Ionicons -->
<!--<link href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />-->

<link href="http://zt.dreamhup.com/public/static/css/ui-dialog.css" rel="stylesheet" type="text/css" />
<!-- Theme style -->
<link href="http://zt.dreamhup.com/public/static/adminlte/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
<!-- AdminLTE Skins. Choose a skin from the css/skins 
     folder instead of downloading all of them to reduce the load. -->
<link href="http://zt.dreamhup.com/public/static/adminlte/dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
<!--<link href="http://zt.dreamhup.com/public/static/adminlte/plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />-->
<link href="http://zt.dreamhup.com/public/static/js/dataTables/css/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<!--<link href="http://cdn.datatables.net/plug-ins/f2c75b7247b/integration/bootstrap/3/dataTables.bootstrap.css"  rel="stylesheet" type="text/css" />-->
<!--<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/black-tie/jquery-ui.css" />-->
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

<link href="http://zt.dreamhup.com/public/static/adminlte/plugins/datepicker/datepicker3.css" rel="stylesheet">
<link href="http://zt.dreamhup.com/public/static/adminlte/plugins/select2/select2.min.css" rel="stylesheet">
<link href="http://zt.dreamhup.com/public/static/adminlte/plugins/iCheck/minimal/_all.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="http://zt.dreamhup.com/public/static/js/easyui/themes/default/easyui.css" title="default" />
<link rel="stylesheet" type="text/css" href="http://zt.dreamhup.com/public/static/js/easyui/themes/bootstrap/easyui.css" title="default" />

    <script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/formvalidator/formValidator.min.js"></script>
<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/formvalidator/formValidatorRegex.js"></script>
<script type="text/javascript">initConfig_setting.theme = 'App';</script>
</head>
<body class="skin-blue-light">
    <!-- Site wrapper -->
    <div class="wrapper">
        <header class="main-header">
            <a href="<?php echo U();?>" class="logo"><b><?php echo C('SYSTEM_NAME');?></b></a>
            <!-- Header Navbar: style can be found in header.less -->
            <nav class="navbar navbar-static-top" role="navigation">
                <!-- Sidebar toggle button-->
                <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div  class="text-right" style="line-height: 50px;margin-right: 10px">
                    <span style="color:#FFF"><?php echo ($userInfo["username"]); ?> [<?php echo ($userInfo["rolename"]); ?>] |</span>
                    <a href="javascript:logout();" style="color: #FFF;" > 退出</a>
                </div>
            </nav>
        </header>
        <!-- Left side column. contains the sidebar -->
        <aside class="main-sidebar">
            <!-- sidebar: style can be found in sidebar.less -->
            <section class="sidebar ">
    <div class="user-panel">
        <div class="pull-left image">
            <img alt="User Image"  src="http://zt.dreamhup.com/public/static/adminlte/dist/img/logo.png">
        </div>
        <div class="pull-left info">
            <p>Hello, <?php echo ($userInfo["username"]); ?></p>
            <a href="javascript:loadContent('<?php echo U('admin/public_editinfo');?>')">个人信息</a>
            <a href="javascript:loadContent('<?php echo U('admin/public_editpwd');?>')">修改密码</a>
        </div>
    </div>
    <ul class="sidebar-menu">
        <?php if(is_array($treeData)): foreach($treeData as $key=>$data): ?><li class="treeview">
                <a href="#">
                    <i class="fa <?php echo ($data[icon]); ?>"></i> <span class="title"><?php echo ($data['name']); ?></span>
                    <i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                    <?php if(is_array($data[son])): foreach($data[son] as $key=>$cdata): ?><li><a href="<?php echo ($cdata[url]); ?>" class="nav">
                        <i class="fa  fa-angle-double-right"></i><?php echo ($cdata[text]); ?></a></li><?php endforeach; endif; ?>
                </ul>
            </li><?php endforeach; endif; ?>
</section>

            <!-- /.sidebar -->
        </aside>
        <!-- =============================================== -->
        <!-- Right side column. Contains the navbar and content of the page -->
        <div class="content-wrapper" id="pageContent" >
            <!-- Content Header (Page header) -->
            <section class="content-header" >
                <h1>
                    后台首页
                    <small>欢迎使用</small>
                </h1>
                <ol class="breadcrumb">
                    <li><a href="<?php echo U();?>"><i class="fa fa-dashboard"></i> 首页</a></li>
                    <li class="active">系统总览</li>
                </ol>
            </section>
            <!-- Main content -->
             <section class="content">
    <div>
        <div class="row">
            <div class="col-md-6">
                <div class="box box-success ">
                    <div class="box-header with-border">
                        <h3 class="box-title">我的个人信息</h3>
                    </div>
                    <div class="box-body" style="padding:8px;line-height:1.8">
                        您好，<?php echo ($userInfo["username"]); ?><br/>
                        所属角色：<?php echo ($userInfo["rolename"]); ?> <br/>
                        最后登录时间：
                        <?php if($userInfo['lastlogintime'] > 0): echo (date('Y-m-d
                            H:i:s',$userInfo["lastlogintime"])); endif; ?>
                        <br/>
                        最后登录IP：<?php echo ($userInfo["lastloginip"]); ?> <br/>
                    </div>
                </div>
            </div>

        </div>
        <?php if(session('userid') == 1): ?><div class="row">
                <div class="col-md-6">
                    <div class="box box-warning">
                        <div class="box-header with-border">
                            <div class="box-title">服务器参数</div>
                        </div>
                        <div class="box-body" style="padding:8px;line-height:1.8">
                            服务器域名/IP地址：<?php echo ($_SERVER['SERVER_NAME']); ?>(
                            <?php if(DIRECTORY_SEPARATOR == '/'): echo ($_SERVER['SERVER_ADDR']); ?>
                                <?php else: ?>
                                <?php echo @gethostbyname($_SERVER['SERVER_NAME']); endif; ?>
                            ) <br/>
                            服务器标识：
                            <?php if($sysinfo['win_n'] != ''): echo ($sysinfo["win_n"]); ?>
                                <?php else: ?>
                                <?php echo @php_uname(); endif; ?>
                            <br/>
                            服务器操作系统：<?php echo ($os["0"]); ?> &nbsp;内核版本：
                            <?php if(DIRECTORY_SEPARATOR == '/'): echo ($os["2"]); ?>
                                <?php else: ?>
                                <?php echo ($os["1"]); endif; ?>
                            <br/>
                            服务器解译引擎：<?php echo ($_SERVER['SERVER_SOFTWARE']); ?> <br/>
                            服务器语言：<?php echo getenv("HTTP_ACCEPT_LANGUAGE");?> <br/>
                            服务器端口：<?php echo ($_SERVER['SERVER_PORT']); ?> <br/>
                            服务器主机名：
                            <?php if(DIRECTORY_SEPARATOR == '/'): echo ($os["1"]); ?>
                                <?php else: ?>
                                <?php echo ($os["2"]); endif; ?>
                            <br/>
                            管理员邮箱：<?php echo ($_SERVER['SERVER_ADMIN']); ?> <br/>
                            绝对路径：<?php echo SITE_DIR;?> <br/>
                            上传文件最大限制（upload_max_filesize）：<?php echo get_cfg_var('upload_max_filesize');?> <br/>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="box box-warning">
                        <div class="box-header with-border">
                            <div class="box-title">服务器实时数据</div>
                        </div>
                        <div class="box-body" style="padding:8px;line-height:1.8">
                            <?php if(($sysinfo["sysReShow"]) == "show"): ?>服务器当前时间：<span><?php echo ($sysinfo["stime"]); ?></span> <br/>
                                服务器已运行时间：<span><?php echo ($sysinfo["uptime"]); ?></span> <br/>
                                总空间：<?php echo ($sysinfo["DiskTotal"]); ?>&nbsp;GB &nbsp;&nbsp;&nbsp;&nbsp;<span
                                    title="显示的是网站所在的目录的可用空间，非服务器上所有磁盘之可用空间！">可用空间</span>： <font color='#CC0000'><span><?php echo ($sysinfo["freeSpace"]); ?></span></font>&nbsp;GB<br/>
                                CPU型号 [<?php echo ($sysinfo["cpu"]["num"]); ?>核]：<?php echo ($sysinfo["cpu"]["model"]); ?> <br/>
                                内存使用状况：物理内存：共<font color='#CC0000'><?php echo ($sysinfo["TotalMemory"]); ?></font>, 已用<font
                                    color='#CC0000'><span><?php echo ($sysinfo["UsedMemory"]); ?></span></font>, 空闲<font
                                    color='#CC0000'><span><?php echo ($sysinfo["FreeMemory"]); ?></span></font>, 使用率<span><?php echo ($sysinfo["memPercent"]); ?></span>
                                <br/>
                                <div class="bar">
                                    <div class="barli_green" style="width:<?php echo ($sysinfo["memPercent"]); ?>">&nbsp;</div>
                                </div>
                                <?php if($sysinfo['CachedMemory'] > 0): ?>Cache化内存为 <span><?php echo ($sysinfo["CachedMemory"]); ?></span>,
                                    使用率<span><?php echo ($sysinfo["memCachedPercent"]); ?></span> % | Buffers缓冲为
                                    <span><?php echo ($sysinfo["Buffers"]); ?></span>
                                    <div class="bar">
                                        <div class="barli_blue" style="width:<?php echo ($sysinfo["barmemCachedPercent"]); ?>">
                                            &nbsp;</div>
                                    </div>
                                    真实内存使用 <span><?php echo ($sysinfo["memRealUsed"]); ?></span>,
                                    真实内存空闲<span><?php echo ($sysinfo["memRealFree"]); ?></span>, 使用率<span><?php echo ($sysinfo["memRealPercent"]); ?></span>
                                    %
                                    <div class="bar_1">
                                        <div class="barli_1" style="width:<?php echo ($sysinfo["barmemRealPercent"]); ?>">&nbsp;</div>
                                    </div><?php endif; ?>
                                <?php if($sysinfo['TotalSwap'] > 0): ?>SWAP区：共<?php echo ($sysinfo["TotalSwap"]); ?>, 已使用<span><?php echo ($sysinfo["swapUsed"]); ?></span>, 空闲<span><?php echo ($sysinfo["swapFree"]); ?></span>,
                                    使用率<span><?php echo ($sysinfo["swapPercent"]); ?></span> %
                                    <div class="bar">
                                        <div class="barli_red" style="width:<?php echo ($sysinfo["barswapPercent"]); ?>">&nbsp;</div>
                                    </div><?php endif; ?>
                                系统平均负载：<span><?php echo ($sysinfo["loadAvg"]); ?></span>
                                <?php else: ?>
                                无法获取当前服务器实时数据<?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6">
                    <div class="box box-danger">
                        <div class="box-header with-border">
                            <div class="box-title">网络使用状况</div>
                        </div>
                        <div class="box-body" style="padding:8px;line-height:1.8">
                            <?php if(($net_state) != ""): echo ($net_state); ?>
                                <?php else: ?>
                                无法获取当前服务器网络使用信息<?php endif; ?>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="box box-danger">
                        <div class="box-header with-border">
                            <div class="box-title">系统说明</div>
                        </div>
                        <div class="box-body" style="padding:8px;line-height:1.8">
                            当前系统版本：<?php echo C('SYSTEM_VERSION');?><br/>
                            ThinkPHP：<?php echo (THINK_VERSION); ?><br/>
                        </div>
                    </div>
                </div>
            </div><?php endif; ?>
    </div>
</section><!-- /.content -->
        </div><!-- /.content-wrapper -->
    </div><!-- ./wrapper -->

<script src="http://zt.dreamhup.com/public/static/js/dialog-plus-min.js" type="text/javascript"></script>
<!-- SlimScroll -->
<script src="http://zt.dreamhup.com/public/static/adminlte/plugins/slimScroll/jquery.slimScroll.min.js" type="text/javascript"></script>
<!-- FastClick -->
<script src='http://zt.dreamhup.com/public/static/adminlte/plugins/fastclick/fastclick.min.js'></script>
<!-- AdminLTE App -->
<script src="http://zt.dreamhup.com/public/static/adminlte/dist/js/app.min.js" type="text/javascript"></script>
<!--<script type="text/javascript" charset="utf8" src="http://cdn.datatables.net/1.10.7/js/jquery.dataTables.js"></script>-->
<!--<script src="http://cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js" type="text/javascript"></script>-->
<!--<script src="http://zt.dreamhup.com/public/static/adminlte/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script>-->
<script src="http://zt.dreamhup.com/public/static/js/dataTables/js/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="http://zt.dreamhup.com/public/static/js/dataTables/js/dataTables.bootstrap.min.js" type="text/javascript"></script>
<!--<script src="http://zt.dreamhup.com/public/static/adminlte/plugins/datatables/dataTables.bootstrap.js" type="text/javascript"></script>-->

<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/form-validator/jquery.form-validator.min.js"></script>
<!-- artDialog -->


<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/vendor/jquery.ui.widget.js"></script>
<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/jquery.fileupload.js"></script>
<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/layer/layer.js"></script>

<script src='http://zt.dreamhup.com/public/static/adminlte/plugins/select2/select2.full.min.js'></script>
<script src='http://zt.dreamhup.com/public/static/adminlte/plugins/select2/i18n/zh-CN.js'></script>
<script src='http://zt.dreamhup.com/public/static/adminlte/plugins/iCheck/icheck.min.js'></script>

<!--<script type="text/javascript" src="http://zt.dreamhup.com/public/static/js/jquery.qrcode.min.js"></script>-->
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=q7jxbkyGIaPyS1XEPPhLrTFFtfZFfi5f"></script>

<script type="text/javascript">
    //退出登录
    function logout() {
        $.messager.confirm('提示信息', '确定要退出登录吗？', function (result) {
            if (result)
                window.location.href = "<?php echo U('Index/logout');?>";
        });
    }
    //防止登录超时
    setInterval(function () {
        $.get("<?php echo U('Index/public_sessionLife');?>");
    }, 600000);
    $(".treeview-menu .nav").each(function () {
        var This = $(this);
        $(this).click(function () {
            $(".treeview-menu li").removeClass('active');
            This.parent().addClass('active');
            loadContent(This.attr("href"));
            return false;
        });
    });

    function loadContent(url) {
        $("#pageContent").load(url,null,function(){
            //easeUi
            $.parser.parse('#pageContent');
            $("#pageContent").attr("href", url);
        });

    }

    function reloadContent() {
        $("#pageContent").load($("#pageContent").attr("href"));
    }
</script>
</body>
</html>